package GUI;

import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.GridLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;

import client.OBL_Client;

public class NotifyDialog extends JDialog {

	public NotifyDialog(final Client_GUI parent,String text) {
		this.setLayout(new FlowLayout());
		
		parent.setEnabled(false);
				
		JLabel toDisplay = new JLabel(text);
		this.add(toDisplay);

		JButton okBtn = new JButton("OK");
		okBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				setVisible(false);
				parent.setEnabled(true);
			}
		});
		this.add(okBtn);
		
		this.setLocation(400, 200);
		
		this.pack();
		this.setVisible(true);
	}

	public NotifyDialog(Frame owner) {
		super(owner);
	}

	public NotifyDialog(Dialog owner) {
		super(owner);
	}

	public NotifyDialog(Window owner) {
		super(owner);
	}

	public NotifyDialog(Frame owner, boolean modal) {
		super(owner, modal);
	}

	public NotifyDialog(Frame owner, String title) {
		super(owner, title);
	}

	public NotifyDialog(Dialog owner, boolean modal) {
		super(owner, modal);
	}

	public NotifyDialog(Dialog owner, String title) {
		super(owner, title);
	}

	public NotifyDialog(Window owner, ModalityType modalityType) {
		super(owner, modalityType);
	}

	public NotifyDialog(Window owner, String title) {
		super(owner, title);
	}

	public NotifyDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
	}

	public NotifyDialog(Dialog owner, String title, boolean modal) {
		super(owner, title, modal);
	}

	public NotifyDialog(Window owner, String title, ModalityType modalityType) {
		super(owner, title, modalityType);
	}

	public NotifyDialog(Frame owner, String title, boolean modal,
			GraphicsConfiguration gc) {
		super(owner, title, modal, gc);
	}

	public NotifyDialog(Dialog owner, String title, boolean modal,
			GraphicsConfiguration gc) {
		super(owner, title, modal, gc);
	}

	public NotifyDialog(Window owner, String title, ModalityType modalityType,
			GraphicsConfiguration gc) {
		super(owner, title, modalityType, gc);
	}

}
